export interface Rule {
  test: string;
  use: string[] | object[];
}

export interface Origin {
  originUrl: string;
  name: string;
  options?: FetchOptions;
  rules?: Rule[];
}

export interface FetchOptions {
  body?: BodyInit;
  headers?: HeadersInit;
  method?: string;
  redirect?: RequestRedirect;
  signal?: AbortSignal | null;
  compress?: boolean; // =true support gzip/deflate content encoding. false to disable
  follow?: number; // =20 maximum redirect count. 0 to not follow redirect
  size?: number; // =0 maximum response body size in bytes. 0 to disable
  timeout?: number;      // http(s).Agent instance or function that returns an instance (see below)
}

export interface Config {
  rootPath: string;
  outDir: string;
  typingDir: string;
  fileType: string;
  origins: Origin[];
  rules: Rule[];
  servicesHeader: string;
}